<template>
    <div style="min-height:100vh;background:#f5f5f5" class="getPutforward">
        <router-link to="/login" id="toLogin"></router-link>
        <top-bar title="提现记录"></top-bar>
        <mu-tabs :value.sync="status" inverse color="#55A9FF" text-color="#666666" indicator-color="#55A9FF"  center>
            <mu-tab>申请中</mu-tab>
            <mu-tab>已完成</mu-tab>
            <mu-tab>已驳回</mu-tab>
        </mu-tabs>
        <div v-if="Object.keys(data).length>0">
            <div class="demo-text" v-if="status==0">
                <ul class="">
                    <li v-for="(item,index) in data" :key="index" class="getPutforwardLists">
                        <p class="listMoney">
                            <span>{{item.put_type}}</span>
                            <span class="money">￥{{item.put_money}}</span>
                        </p>
                        <div class="listTime">
                            <p>申请时间：{{item.create_time}}</p>
                        </div>
                        
                    </li>
                </ul>
            </div>
            <div v-else></div>
            <div class="demo-text" v-if="status==1">
                <ul class="">
                    <li v-for="(item,index) in data" :key="index" class="getPutforwardLists">
                        <p class="listMoney">
                            <span>{{item.put_type}}</span>
                            <span class="money">￥{{item.put_money}}</span>
                        </p>
                        <div class="listTime">
                            <p v-if="item.update_time">完成时间：{{item.update_time}}</p>
                            <p>申请时间：{{item.create_time}}</p>
                            
                        </div>
                    </li>
                </ul>
            </div>
            <div v-else></div>
            <div class="demo-text" v-if="status==2">
                <ul class="">
                    <li v-for="(item,index) in data" :key="index" class="getPutforwardLists">
                        <p class="listMoney">
                            <span>{{item.put_type}}</span>
                            <span class="money">￥{{item.put_money}}</span>
                        </p>
                        <div class="listTime">
                            <p v-if="item.update_time">完成时间：{{item.update_time}}</p>
                            <p>申请时间：{{item.create_time}}</p>
                            
                        </div>
                        <div class="reason">
                            驳回原因：{{item.remark}}
                        </div>
                    </li>
                </ul>
            </div>
            <div v-else></div>
        </div>
        
        <div style="text-align:center;padding-top:50px" v-else>
            <img src="@/images/neitui/21.png" alt="" style="width:275px">
            <p style="margin-top:10px">暂无提现记录</p>
        </div>

    </div>
</template>

<script>
import request from '@/request/index.js'
import topBar from '@/components/common/topBar1.vue'
  export default {
    name: 'cashApply',
    components:{
      topBar,
    },
    data(){
      return{
        data:{},
        token:'',
        status:0,
      }
    },
    watch:{
        status(newVal,oldVal){
            request.getPutforward(this);
        }
    },
    methods:{

    },
    mounted(){
        const loading = this.$loading({
                // ...options
                color:'#55A9FF',
                overlayColor:'rgba(0,0,0,.5)',
                className: 'loadingStyle',
            });
      if(this.$route.query.token){
                this.$cookie.set('token',this.$route.query.token,7);
                this.token=this.$cookie.get('token');
            }else{
                if(this.$cookie.get('token')){
                    this.token=this.$cookie.get('token');
                }
                else{
                    document.getElementById('toLogin').click();
                }
            }
      request.getPutforward(this,loading);
    }
  }
</script>

<style scoped lang="scss">
    .getPutforward{
        .getPutforwardLists{
            margin-top:10px;
            background: #ffffff;
            .listTime{
                color:#999999;
                font-size:12px;
                padding: 1em 4vw;
                border-top:1px solid #f5f5f5;
                // line-height: 3em;
                // padding:  0;
                line-height: 2em;
            }
            .listMoney{
                color:#666666;
                font-size:14px;
                padding: 0 4vw;
                line-height: 4em;
                .money{
                    color:#E8A31C;
                    font-size: 20px;
                    float:right;
                }
            }
            .reason{
                color:#FF4C50;
                padding:0 4vw;
                padding-bottom: 1em;
            }
        }
    }
</style>
